home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / lang_c / mc51bugs / q32029 < prev    next >
Text File  |  1988-07-20  |  771b  |  37 lines

  1. Q32029 Incorrect Code Generated For Loop
  2. C Compiler
  3. 5.10
  4. MS-DOS
  5.  
  6. Summary:
  7.    The source code below generates incorrect code when compiled. The
  8. effect is to have the si register loaded with a value from bp-4. This
  9. space was allocated by the compiler, but never written to by the
  10. routine.
  11.  
  12. More Information:
  13.    The source code is as follows:
  14.  
  15. int c_row;
  16. right_shft(inc)
  17. int inc;
  18. {
  19.   extern int y_pos[],y_inc[];
  20.   int i;
  21.   {
  22.      for(i=y_pos[c_row];i<(y_pos[c_row]+y_inc[c_row]);i+=inc)
  23. /* One portion of the code generated for this line is:
  24.  
  25.               mov si, WORD PTR [bp-4]
  26.  
  27.  but bp-4 has not been initialized and contains some random value
  28. */
  29.  
  30.               writedot();
  31.  
  32.   }
  33. }
  34.  
  35. Keywords:  buglist5.10 qfbv
  36. Updated  88/07/21 03:19
  37.